package com.foreverwin.mes.production.service;


import com.baomidou.mybatisplus.service.IService;
import com.foreverwin.mes.core.exception.BusinessException;
import com.foreverwin.mes.production.model.WorkCenterShift;
import com.foreverwin.mes.production.model.WorkCenterShiftView;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 工作中心班次设定 服务类
 * </p>
 *
 * @author syngna
 * @since 2018-12-14
 */
public interface WorkCenterShiftService extends IService<WorkCenterShift> {

    /**
     * 查询单笔班次设定
     * @param workCenterShift
     * @return
     */
    WorkCenterShift selectOne(WorkCenterShift workCenterShift);

    /**
     * 查询班次设定
     * @param site
     * @param workCenter
     * @return
     */
    List<WorkCenterShiftView> getWCShiftList(String site, String workCenter);

    /**
     * 保存班次设定
     * @param workCenterShift
     * @return
     */
    void saveWorkCenterShift(String site, String user, WorkCenterShift workCenterShift) throws BusinessException;


    /**
     * 查询设备的当前班次
     * @param site
     * @param resource
     * @param currentDate
     * @return
     */
    Map<String,Object> getCurrentShiftOfResource(String site, String resource, Date currentDate) throws BusinessException;

    /**
     * 查询设备的当前班次,会查满足预约的班次
     * @param site
     * @param resource
     * @param currentDate
     * @return
     */
    Map<String,Object> getAppointOrCurrentShiftOfResource(String site, String resource, Date currentDate) throws BusinessException;


    /**
     * 修改设定关系状态
     * @param handles
     * @param status Y:有效；N:无效
     * @param modifyUser
     * @param modifiedDateTime
     * @return
     */
    void updateBatchHandles(String status, String modifyUser, Date modifiedDateTime, List<String> handles) throws BusinessException;
}